package alibaba.nulldemo.NullObjectPattern.demo01;

import alibaba.nulldemo.NullObjectPattern.Action;
import alibaba.nulldemo.NullObjectPattern.ActionImpl;
import alibaba.nulldemo.NullObjectPattern.Parser;

/**
 * @author ChangLiang
 * @date 2020/4/21
 */
public class ParserImpl implements Parser {
    @Override
    public Action findAction(String userInput) {
        Action action = null;
        switch (userInput){
            case "do A":
                System.out.println("do A");
                action = new ActionImpl();
                break;
            case "do B":
                System.out.println("do B");
                action = new ActionImpl();
                break;
            default:
                break;
        }
        return action;
    }
}
